package testcase;

import static org.testng.Assert.assertEquals;

import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import base.BaseDriver;
import pages.LoginPage;

public class LoginPageTest extends BaseDriver{

	LoginPage login_page;
	@BeforeMethod
	public void login() {
		login_page = new LoginPage(driver);
	}
	
	/*
	 * 1、成功登录
	 */
	@Test
	public void testLoginSucess() throws InterruptedException {
		login_page.loginSuccess("admin","123456");
		System.out.println(driver.currentActivity());
		assertEquals(driver.currentActivity(), 
				".MainActivity");	
	}
	
	/*
	 * 2、失败登录
	 */
	@Test
	public void testLoginFail() throws InterruptedException {
		boolean flag=login_page.loginFail("1", "2");
		assertEquals(flag, true);
	}
}
